import 'core-js/es6/map';
import 'core-js/es6/set';
import 'core-js';
import 'raf/polyfill';
import React from "react";
import ReactDOM from "react-dom";
import { createStore, applyMiddleware} from 'redux'
import thunk from 'redux-thunk'
import { Provider } from 'react-redux'
import PointRouter from "./route/pointRouter"
import reducers from './reducer'
import "./index.css";
import {persistStore, persistReducer} from "redux-persist";
import { PersistGate } from "redux-persist/es/integration/react";
import storage from "redux-persist/es/storage";
const persistConfig = {
    key: 'root',
    storage,
}
const persistedReducer = persistReducer(persistConfig, reducers)
const store = createStore(persistedReducer,
        applyMiddleware(thunk),
    );
ReactDOM.render(
        <Provider store={store}>
            <PersistGate persistor={persistStore(store)}>
                <PointRouter> </PointRouter>
            </PersistGate>
        </Provider>
    , 
    document.getElementById("root")
);
